CommandStack = Class.extend({
		NAME : "lantu.CommandStack", 


		init: function( )
		{
		   this.undostack = [];
		   this.redostack = [];
		   this.maxundo = 50;
		},
		 undo: function()
		{
		   var shape = this.undostack.pop();
		   if(shape)
		   {
			  this.redostack.push(shape);
			  obj_set.remove(shape);
			  shape.selectize(false);
			  shape.resize(false);
			  shape.draggable(false);
			  shape.remove();
		   }
		   
		   return this;
		},
	   
		redo: function()
		{
		   var shape = this.redostack.pop();
		
		   if(shape){
			  this.undostack.push(shape);
			  draw.add(shape);
			  obj_set.add(shape);
		   }
		   
		   return this;
		}
	});